package plp.funcoo.expressions;

import plp.funcoo.dec.parameter.ParameterList;
import plp.funcoo.environment.compilation.CompilationEnvironment;
import plp.funcoo.environment.compilation.Environment;
import plp.funcoo.environment.execution.ExecutionEnvironment;
import plp.funcoo.exceptions.ClassAlreadyDeclared;
import plp.funcoo.exceptions.ClassNotDeclared;
import plp.funcoo.exceptions.MethodAlreadDeclared;
import plp.funcoo.exceptions.MethodNotDeclared;
import plp.funcoo.exceptions.ParameterNumberIncorrect;
import plp.funcoo.exceptions.ParameterTypeIncorrect;
import plp.funcoo.exceptions.VarAlreadyDeclared;
import plp.funcoo.exceptions.VarNotDeclared;
import plp.funcoo.types.PrimitiveType;
import plp.funcoo.util.Type;
import plp.funcoo.value.AbstractValue;

public class FunctionValue extends AbstractValue{

	//HashMap<Identifier,Expression> map;
	ParameterList listPar;
	public ParameterList getListPar() {
		return listPar;
	}


	public void setListPar(ParameterList listPar) {
		this.listPar = listPar;
	}


	public ExpressionList getListArg() {
		return listArg;
	}


	public void setListArg(ExpressionList listArg) {
		this.listArg = listArg;
	}

	ExpressionList listArg;
	public FunctionValue(ParameterList listPar, ExpressionList listArg, Expression expExecute)
	{
		super(expExecute);
		this.listArg = listArg;
		this.listPar = listPar;
		/*ParameterDeclaration auxPar;
		Expression auxExp;
		
		while(listPar.length() > 0)
		{
			auxPar = listPar.getNext();
			auxExp = listArg.getNext();
			
			if(auxExp != null)
				map.put(auxPar.getId(), auxExp);
			else
				map.put(auxPar.getId(), new VoidValue(""));
			
		}*/
	}
	
	
	FunctionValue(Expression exp) {
		super(exp);
		// TODO Auto-generated constructor stub
	}

	@Override
	public Type getValue() {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public ExecutionEnvironment evaluate(ExecutionEnvironment envi)
			throws VarNotDeclared, MethodNotDeclared, VarAlreadyDeclared,
			MethodAlreadDeclared {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public boolean typeCheck(CompilationEnvironment envi)
			throws VarAlreadyDeclared, VarNotDeclared, ClassAlreadyDeclared,
			ClassNotDeclared, MethodAlreadDeclared, MethodNotDeclared,
			ParameterTypeIncorrect, ParameterNumberIncorrect {
		// TODO Auto-generated method stub
		return false;
	}

	@Override
	public Type getType(Environment envi) throws VarNotDeclared,
			ClassNotDeclared {
		return PrimitiveType.Type_FUNC;
	}

	@Override
	public Expression makeCopy() {
		// TODO Auto-generated method stub
		return null;
	}

}
